package com.test.service.impl;

import com.test.mapper.BaseMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.Serializable;
import java.util.List;

/**
 * Created by Lenovo on 2019/1/9.
 */
@Service
public class BaseServiceImpl<PO extends Serializable>{

    @Autowired
    private BaseMapper<PO> baseMapper;

    public int deleteByPrimaryKey(Long id) {
        return baseMapper.deleteByPrimaryKey(id);
    }

    public int insert(PO record) {
        return baseMapper.insert(record);
    }

    public int insertSelective(PO record) {
        return baseMapper.insertSelective(record);
    }

    public PO selectByPrimaryKey(Long id) {
        return baseMapper.selectByPrimaryKey(id);
    }

    public int updateByPrimaryKey(PO record) {
        return baseMapper.updateByPrimaryKey(record);
    }

    public int updateByPrimaryKeySelective(PO record) {
        return baseMapper.updateByPrimaryKeySelective(record);
    }

    public List<PO> selectAll(){
        List<PO> poList = baseMapper.selectAll();
        return poList;
    }
}
